<?php
/**
 * 
 * Partial template for the user authentication form.
 * 
 * @category Abovo
 * 
 * @package Abovo_App_System
 * 
 * @subpackage Abovo_App_System_User
 * 
 * @author Antti Holvikari <anttih@gmail.com>
 * 
 * @license http://opensource.org/licenses/gpl-license.php GPL
 * 
 */
?>
<?php if (! Solar::registry('user')->auth->isValid()): ?>
    <?php $msg = Solar::registry('user')->auth->getFlash('status_text'); ?>
    <?php if (! empty($msg)): ?>
        <?php $class = ($msg == Solar::$locale->fetch('Solar_Auth_Adapter', 'WRONG')) ? 'failure' : 'success' ; ?>
        <ul class="<?php echo $class ?>"><li><?php echo $this->escape($msg); ?></li></ul>
    <?php endif; ?>
    <?php echo $this->form(array('action' => $this->action('/'), 'method' => 'post'))
                    ->text(array(
                        'name'    => 'handle',
                        'label'   => $this->getTextRaw('LABEL_HANDLE'),
                        'attribs' => array('size' => 12),
                    ))
                    ->password(array(
                        'name'    => 'passwd',
                        'label'   => $this->getTextRaw('LABEL_PASSWD'),
                        'attribs' => array('size' => 12)
                    ))
                    ->submit(array(
                        'name'    => 'process',
                        'value'   => $this->getTextRaw('PROCESS_LOGIN')
                    ))
                    ->fetch();
    ?>
<?php endif; ?>